<?php
error_reporting(0);
header("Access-Control-Allow-Origin:*");
if(empty($_POST)){
	exit("");	
}else{
	$data = $_POST;
}


//引导页 样式表 css 绝对地址
$web_style = 'http://www.amnvren.com/shb/css/style_color_sb.css';
//引导页 访客 头像  绝对地址
$web_cus_head = 'http://www.amnvren.com/shb/images/user_head_img.jpg';
//引导页 医生 头像  绝对地址
$web_doc_head = 'http://www.amnvren.com/shb/images/doctor.jpg';
//引导页面的 第一句引导语
$web_first_msg = '在的!';
//引导页面的 第二句引导语
$web_second_msg = '你好,有什么问题?今年多大年龄了?';

//商务通直接对话url
$dh_url = 'http://put.zoosnet.net/LR/Chatpre.aspx?id=PUT12920167&lng=cn';
//标示
$huifu = '%e4%b8%bb%e5%8a%a8%e5%9b%9e%e5%a4%8d--%e5%85%b3%e9%94%ae%e8%af%8d%3a';

$platform = strtolower($data['platform']);
if(strstr($platform,'win') || $data["sear_wd"]==""){
	
	$arr_res['code'] = 0;
	$arr_res['con'] = "";
	

}else{
	$arr_res['code'] = 1;
	$arr_res['con'] = "document.querySelector(\"html\").innerHTML=res['html'];
(function( window, undefined ) {   
  with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = '//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'];
})(window); 


function fun_tem(){
	if (window.jQuery) {		
		
		var wd = \"".urldecode($data["sear_wd"])."\",
			wd1 = \"".$data["sear_wd"]."\",
			dp = encodeURIComponent(window.location.href);
		
		
		if (wd.length > 0) {
			setTimeout(function() {
				$('#ly_search_wd_div').fadeIn(100)
			}, 300);
			$(\"#ly_search_wd_div_wd\").html(wd);
		} else {
			
		}
		
		function LR_checkagent(_lr_na) {    var _lr_o = _lr_na.split(\"|\");    for (_lr_w = 0; _lr_w < _lr_o.length; _lr_w++) {        if(navigator.userAgent.toLowerCase().indexOf(_lr_o[_lr_w]) > -1) return true;    }    return false;};var is_ios = LR_checkagent(\"ipad|iphone|ipod\");var is_baidu = LR_checkagent(\"baiduboxapp\");
		$(\"#texteditor\").on(\"click\",function(){if(is_ios){setTimeout(function(){document.body.scrollTop =document.body.scrollHeight;},300);}});

		$(\"#shb-bottomsend\").on(\"click\", function() {
			
			var val = $(\".shb-editor\").val();
			val = $.trim(val);
			val = decodeURIComponent(val);
			
			
			if (/^\\d{2}$/.test(val)) {
				val = val + \"岁\";
			}

			
			val = encodeURIComponent(val);
			var cval = val;
			
			try {
				openZoosUrl('chatwin', '&sear_wd=' + wd1 + '&input_wd=' + val + \"&e=".$huifu."\" + wd1 + \"&p=\"+dp);		
							
			} catch (err) {
				window.location.href = \"".$dh_url."\" + '&sear_wd=' + wd1 + \"&input_wd=\" + val + \"&e=".$huifu."\" + wd1 + \"&p=\" + dp;
			}
		});
		setTimeout(function() {
			$('.shb-ly-section1 .shbydy1').fadeIn(100)
		}, 1500);
		setTimeout(function() {
			$('.shb-ly-section1 .shbydy2').fadeIn(200)
		}, 4500);
		


		$(\".click_func\").on(\"click\", function(){
				var val = $(this).attr(\"title\");
				openZoosUrl('chatwin', '&sear_wd=' + wd1 + '&input_wd=000' + \"&e=\" + val + wd1);
		});


		
	}else{
		
		setTimeout('fun_tem()', 30);
	}
}
fun_tem();";
		
	$arr_res['html'] = "<!DOCTYPE>
<html xmlns:mine>

<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,user-scalable=no\" />
<title>智慧问问-在线咨询</title>
<link href=\"".$web_style."\" rel=\"stylesheet\" >
</head>
<body>
<mine:shb_header class=\"shb-ly-header\">
    <nav style=\"background:#393a3f;\">
        <a id=\"backclick\" class=\"click_func\" title=\"点击返回按钮--关键词：\"><i></i></a>      
        <h2>智慧问问-在线咨询</h2>
    </nav>
</mine:shb_header>

<mine:shb_section><div class=\"shb-ly-section1\">

    <div class=\"line shb-ly-hide ly_search_wd_div\" id=\"ly_search_wd_div\">
        <div class=\"shbright\">
            <img src=\"".$web_cus_head."\" width=\"40px\" id=\"shb_click_fun\" class=\"click_func\" title=\"点击访客人头--关键词：\">
            <div id=\"ly_search_wd_div_wd\" style=\"font-size:14px;background:#b2e866;border:1px solid #d5d5d5;color:#323232;\">
                
            </div>
        </div>
        <div class=\"shb-ly-clear\"></div>
    </div>

    <div class=\"line shb-ly-hide line2 shbydy1\">
        <div class=\"shbleft\">
            <img src=\"".$web_doc_head."\" width=\"40px\" class=\"click_func\" title='点击医生人头1--关键词：'>
            <div class=\"leftydy\">
                <i></i>
                ".$web_first_msg."            </div>
        </div>
        <div class=\"shb-ly-clear\"></div>
    </div>
    <div class=\"line shb-ly-hide line2 shbydy2\">
        <div class=\"shbleft\">
            <img src=\"".$web_doc_head."\" width=\"40px\" class=\"click_func\" title='点击医生人头2--关键词：'>
            <div class=\"leftydy\" style=\"font-size:14px;\">
                <i></i>
                ".$web_second_msg."           </div>
        </div>
        <div class=\"shb-ly-clear\"></div>
    </div>
    <div class=\"line shb-ly-hide line2 shbydy3\">
        <div class=\"shbleft\">
            <img src=\"".$web_doc_head."\" width=\"40px\" class=\"click_func\" title='点击医生人头3--关键词：'>
            <div class=\"leftydy\">
                <i></i>
                            </div>
        </div>
        <div class=\"shb-ly-clear\"></div>
    </div>
    <div class=\"line shb-ly-hide line2 shbydy4\">
        <div class=\"shbleft\">
            <img src=\"".$web_doc_head."\" width=\"40px\" class=\"click_func\" title='点击医生人头4--关键词：'>
            <div class=\"leftydy\">
                <i></i>
                            </div>
        </div>
        <div class=\"shb-ly-clear\"></div>
    </div></div>
</mine:shb_section>

<mine:shb_footer><div class=\"shb_ly-footer\"><div><a class=\"click_func\" title=\"点击语音按钮--关键词：\"></a></div>    <div>  <textarea id=\"texteditor\" class=\"shb-editor\" placeholder=\"请在此输入...\" wrap=\"virtual\"></textarea>  <i></i>    </div>    <div><a id=\"shb-bottomsend\">发送</a></div></div></mine:shb_footer>";
	
}

echo json_encode($arr_res);
?>